<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css"/>
	</head>
	<body>
	<div class="am-g">
		 {include file='../Common/hy_header.html'}
		<div class="am-tabs am-margin" data-am-tabs="{ noSwipe: 1}">
    <ul class="am-tabs-nav am-nav am-nav-tabs">
      <li class="am-active"><a hidefocus="true" href="#tab1">中文详情</a></li>
      <li class=""><a hidefocus="true" href="#tab2">其他选项</a></li>
</ul>

    <form class="am-tabs-bd am-form hy-js-form" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
      
      <div class="am-tab-panel am-fade am-active am-in" id="tab1">
          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              标题
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input type="text" name="title" value="{$ad.title}" class="am-input-sm">
            </div>
          </div>

          

          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              记者
            </div>
            <div class="am-u-sm-4 am-u-end">
            	<input type="text" name="description" value="{$ad.description}" class="am-input-sm">
            </div>
          </div>
          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
             创建时间
            </div>
            <div class="am-u-sm-4 am-u-end">
            	<input id="created" type="text" name="created" value="{$ad.created|date_format:'%Y-%m-%d'}"/>
            </div>
          </div>

          
      </div>
      <div class="am-tab-panel am-fade" id="tab4">
          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              英文标题
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input type="text" name="en_title" value="{$ad.en_title}" class="am-input-sm">
            </div>
          </div>
          <div class="am-g am-margin-top">
          </div>

      </div>
      <div class="am-tab-panel am-fade " id="tab2">
        
        
          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
             链接
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input name="url" value="{$ad.url|default:'http://'}" type="text" class="am-input-sm">
            </div>
			</div>
			<div class="am-g am-margin-top">
	            <div class="am-u-sm-2 am-text-right">
	             广告位
	            </div>
	            <div class="am-u-sm-4 am-u-end">
	            	<select id="ad_place" name="ad_place">
	            		{section name=loop loop=$adCount} 
							<option {if $ad.ad_place eq $smarty.section.loop.index+1}selected="selected" {/if} value="{$smarty.section.loop.index+1}">{$smarty.section.loop.index+1}</option>  
						{/section}
					</select>
	            </div>
            
          </div>
			<div class="am-g am-margin-top">
	            <div class="am-u-sm-2 am-text-right">
	             广告开始时间
	            </div>
	            <div class="am-u-sm-4 am-u-end">
	              <input id="ad_starttime" name="ad_starttime" value="{$ad.ad_starttime|date_format:'Y-m-d H:i:s'}" type="text" class="am-input-sm">
	            </div>
            
          </div>
			<div class="am-g am-margin-top">
	            <div class="am-u-sm-2 am-text-right">
	             广告截止时间
	            </div>
	            <div class="am-u-sm-4 am-u-end">
	              <input id="ad_endtime" name="ad_endtime" value="{$ad.ad_endtime|date_format:'Y-m-d H:i:s'}" type="text" class="am-input-sm">
	            </div>
            
          </div>

 <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              上传图片
            </div>
            <div class="am-u-sm-4">
              <input type="text" name="pic_path" class="am-input-sm" value="{$ad.pic_path}">
             
            </div>
            <div class="am-u-sm-1">
            	 <img id="hy-thumb" style="height: 30px;" {if $ad.pic_path}src="/ws{$ad.pic_path}"{else} src="{$_C.hy_path}images/logo2.png" {/if}>
            	</div>
             <div class="am-u-sm-4 am-u-end">
             	<button class="am-btn am-btn-primary am-btn-xs hy-js-uploadimg" >上传</button>
          </div>
             </div>
			 {if $ad.block_id eq 19||{$bid} eq 19}
				<span class="am-text-right" style="color:red;">推荐图片尺寸为（高*宽）：544*500</span>
			{else}
				<span class="am-text-right" style="color:red;">推荐图片尺寸为（高*宽）：294*500</span>
			{/if}
        
      </div>
	  
       <input type="hidden" name="block_id" value="{$bid}" />
 <input type="hidden" name="id" value="{$id}" />
    </form>
    <div class="am-margin">
    <button type="button" class="am-btn am-btn-primary hy-js-submit am-btn-xs">提交保存</button>
    
  </div>
  </div>
	</div>	
	 
	  {include file='../Common/hy_footer.html'}
	<script type="text/javascript" src="{$_C.hy_path}js/editor/kindeditor.js"></script>
	<script type="text/javascript" src="{$_C.hy_path}js/laydate/laydate.js"></script>
	<script type="text/javascript">
		$(function(){
			laydate({
			   elem: '#ad_starttime',
			   istime:true,
			   format: 'YYYY-MM-DD hh:mm:ss',
			})
			laydate({
			   elem: '#ad_endtime',
			   istime:true,
			   format: 'YYYY-MM-DD hh:mm:ss',
			})
			laydate({
			   elem: '#created',
			   format: 'YYYY-MM-DD',
			})
		})
	    hy_uploadimg('/ad',{},function(result){
	    	if(typeof(result[0])!='undefined')
	    	{
	        	$('#hy-thumb').attr('src','/ws'+result[0]);
	        	$('input[name=pic_path]').val(result[0]).focus();
	       }
	    })
	    
	    hy_submit('index.php?g=admin&m=ad&a={$action}',{},function(result){
				showMsg(result.content, result.error);
	    		parent.$('#adcontent_{$bid}').attr('src', parent.$('#adcontent_{$bid}').attr('src'));
		});
	</script>
	</body>
</html>
